package com.ruixiang.leetcode;

import lombok.AllArgsConstructor;
import lombok.Data;
import org.junit.Test;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ruixinag
 * @description 测试一些小算法
 * @create Created in 2022/1/15 13:52
 */
public class Demo1 {

    @Test
    public void test01(){
        // 老公组
        List<Couple> husbands = new ArrayList<>();
        husbands.add(new Couple(1, "梁山伯"));
        husbands.add(new Couple(2, "牛郎"));
        husbands.add(new Couple(3, "干将"));
        husbands.add(new Couple(4, "工藤新一"));
        husbands.add(new Couple(5, "罗密欧"));

        // 老婆组
        List<Couple> wives = new ArrayList<>();
        wives.add(new Couple(1, "祝英台"));
        wives.add(new Couple(2, "织女"));
        wives.add(new Couple(3, "莫邪"));
        wives.add(new Couple(4, "毛利兰"));
        wives.add(new Couple(5, "朱丽叶"));

        // 一一匹配
        for (int i = 0; i < husbands.size(); i++) {
            System.out.println(husbands.get(i).getUserName()+"爱"+wives.get(i).getUserName());
        }

    }

    @Data
    @AllArgsConstructor
    class Couple{
        private Integer familyId;
        private String userName;
    }


}
